package com.sys.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sys.dao.StudentDao;
import com.sys.dao.StudentsDao;
import com.sys.entity.Students;
import com.sys.service.StudentsService;
@Service
public class StudentsServiceImpl implements StudentsService{
	@Autowired
	private StudentsDao studentsDao;
	@Override
	public Map<String, Object> getstudent(int page, int limit) {
		Map<String, Object> prams = new HashMap<String, Object>();
		page = (page - 1) * limit;
		prams.put("page", page);
		prams.put("limit", limit);
		List<Students> list = studentsDao.getstudent(prams);
		int total = studentsDao.getstudentCount(prams);
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("list", list);
		map.put("total", total);
		return map;
	}

}
